﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wwtfly.BBS.BackModels.Models.Users;
using Wwtfly.Utility;
using System.Text;
using Wwtfly.BBS.BackModels.Models.Users.Right;
using Wwtfly.BBS.BackBLL.Users;

namespace Wwtfly.BBS.ForeApplication.WebForm
{
    public partial class UserAcount : System.Web.UI.Page
    {
        protected static UsersModel usermd = null;
        protected static string leftLink = "";  //菜单链接
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session[LoginUserUtil.LOGIN_USER] != null)
                {
                    usermd = Session[LoginUserUtil.LOGIN_USER] as UsersModel;
                    StringBuilder linkStr = new StringBuilder();
                    linkStr.Append(" <li><a href=\"default.aspx\" >安全首页</a></li>");
                    linkStr.Append(" <li><a href=\"UserInfo.aspx\" target=\"mainframe\">基本资料</a></li>");
                    linkStr.Append(" <li><a href=\"UserUpdatePwd.aspx\" target=\"mainframe\">修改密码</a></li>");
                    linkStr.Append("<li><a href=\"#\">帮助</a></li>");
                   
                    linkStr.Append(" <li><a href=\"ExpertNewAdd.aspx\" target=\"mainframe\">预测专家申请</a></li>");
                    IList<UARoleInfoModel> userRoleList = UsersBLL.GetUARoleInfoList(usermd.Id);
                    foreach (UARoleInfoModel role in userRoleList)
                    {

                       if(role.RoleID==5){
                           linkStr.Append(" <li><a href=\"ExpertNewAdd.aspx\" target=\"mainframe\">预测专题申请</a></li>");
                           break;
                       }
                    }
                 
                    leftLink = linkStr.ToString();
                }
                else
                {
                  //  Response.Redirect("UserLogin.aspx");
                }
            }
        }
        
    }

    
}